package com.jprocms.module.cms.dal.dataobject.content;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * @TableName cms_content_channel
 */
@NoArgsConstructor
@AllArgsConstructor
@KeySequence("cms_content_channel") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库，可不写。
@TableName(value = "cms_content_channel")
public class ContentSubChannelDO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 内容ID
     */
    private Long contentId;

    /**
     * channelId
     */
    private Long channelId;

    /**
     * 内容ID
     */
    public Long getContentId() {
        return contentId;
    }

    /**
     * 内容ID
     */
    public void setContentId(Long contentId) {
        this.contentId = contentId;
    }

    public Long getChannelId() {
        return channelId;
    }

    public void setChannelId(Long channelId) {
        this.channelId = channelId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ContentSubChannelDO that = (ContentSubChannelDO) o;
        return Objects.equals(contentId, that.contentId) && Objects.equals(channelId, that.channelId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(contentId, channelId);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", contentId=").append(contentId);
        sb.append(", channelId=").append(channelId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}